package com.macro.mall.portal.controller;

import com.macro.mall.common.api.CommonResult;
import com.macro.mall.model.ExpressResponse;
import com.macro.mall.portal.service.ExpressService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Author：尚志豪
 * @Package：com.macro.mall.portal.controller
 * @Project：mall-swarm-B
 * @name：ExpressController
 * @Date：2024/10/31 20:38
 */
@Controller
@Tag(name = "ExpressController",description = "物流查询")
@RequestMapping("express")
public class ExpressController {

    @Autowired
    private ExpressService expressService;

    /**
     * 查询物流
     */
    @Operation(summary = "查询物流")
    @RequestMapping(value = "/query/{expressNo}", method = RequestMethod.POST)
    @ResponseBody
    public CommonResult query(@PathVariable String expressNo){
        ExpressResponse response = expressService.query(expressNo);
        return CommonResult.success(response);
    }
}
